package HealthCard;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tencent.healthcard.impl.HealthCardServerImpl;
import com.tencent.healthcard.model.CommonIn;
import com.tencent.healthcard.model.ReportHISData;

import java.util.UUID;

public class Test_reportHISData {

    public static void main(String[] args) {
        /**
         * 接口：用卡数据监测接口
         */
        //appSecret
        String appSecret="b1d1a14c50a6082e0508b514e75ea4b9";
        HealthCardServerImpl healthCard=new HealthCardServerImpl(appSecret);
        //构造公共输入参数commonIn
        String appToken="74A1EFDDB21941E3ABEB06901B3FD2DF";
        String requestId= UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
        String hospitalId="30135";
        CommonIn commonIn=new CommonIn(appToken,requestId,hospitalId);
        //构造请求参数req
        ReportHISData reportHISData=new ReportHISData();
        String qrCodeText="A3A2993D5E5434B1F9F1BAC314BF3B0BE699E03BE947326B2DC99F59001xxxxx:1";
        reportHISData.setQrCodeText(qrCodeText);
        reportHISData.setIdCardNumber("43110219900816xxxx");
        reportHISData.setName("图南");
        reportHISData.setTime("2019-04-23 11:15:23");
        reportHISData.setHospitalId(hospitalId);
        reportHISData.setScene("010101");
        reportHISData.setDepartment("0100");
        reportHISData.setCardChannel("服务号");
        reportHISData.setCardType("01");
        reportHISData.setCardCostTypes("0100");
        //调用接口
        JSONObject reportHISDataRsp=healthCard.reportHISData(commonIn,reportHISData);
        //打印响应
        System.out.println(JSON.toJSONString(reportHISDataRsp));
    }
}